<!-- 用户管理 -->
<template>
  <div class="app-container">
    <el-row :gutter="20">
      <!-- 部门树 -->

      <!-- 用户列表 -->
      <el-col :lg="24" :xs="24">
        <div class="jiaqitop">
          <div class="titlel">
            <div class="titlel_box"></div>
            <div class="titlel_tt">管理员管理</div>
          </div>
          <el-button class="addtj" color="#003779" @click="popubool = true">
            <img src="/src/assets/images/Union@2x.png" alt="" />
            <span style="margin-left: 6px">添加</span>
          </el-button>
        </div>

        <!-- 搜索区域 -->

        <div class="containers">
          <div class="center1">
            <div class="msgbox" v-if="false">
              <img src="/src/assets/images/Group@2x.png" alt="" />
              <span>暂无数据内容展示，选择人员后查看列表</span>
            </div>
            <el-table
              :data="tableData"
              :header-cell-style="tableHeaderStyle"
              :cell-style="tableHeaderStyle1"
              :span-method="arraySpanMethod"
              border
              style="width: 100%"
            >
              <el-table-column prop="id" fixed align="center" label="ID" width="52" />
              <el-table-column prop="zh" fixed align="center" label="账号" width="210" />
              <el-table-column prop="yijiclassname" align="center" label="昵称" width="167" />
              <el-table-column prop="yijiclassname" align="center" label="所属组别" width="167" />
              <el-table-column prop="zh" align="center" label="手机号" width="248" />
              <el-table-column prop="date" align="center" label="状态" width="243">
                <template #default="scope">
                  <el-tag :type="scope.row.status === 1 ? 'success' : 'info'" disable-transitions>
                    {{ scope.row.status == 1 ? "正常" : "隐藏" }}
                  </el-tag>
                </template>
              </el-table-column>
              <el-table-column prop="addtime" align="center" label="最后登录" width="278" />

              <el-table-column label="操作" fixed="right" align="center" width="163">
                <span
                  @click="popubool = true"
                  style="font-weight: 400; font-size: 1rem; color: #165dff; cursor: pointer"
                >
                  编辑
                </span>
              </el-table-column>
            </el-table>

            <div class="yemmabox">
              <el-pagination
                :small="true"
                :pager-count="4"
                background
                layout="total, pager, next, jumper,slot"
                :total="20"
                style="position: relative"
              >
                <div class="sybox">首页</div>
                <div class="sybox1">尾页</div>
              </el-pagination>
            </div>
          </div>
        </div>
      </el-col>
    </el-row>
    <el-dialog v-model="popubool" :show-close="false" width="44rem" :modal="false" center>
      <template #header>
        <div class="popubox">
          <div class="backtop">
            <div class="topline">
              <div class="text">添加管理员</div>
              <img
                src="/src/assets/images/微信图片_20250903150026_21_215.png"
                @click="popubool = false"
                alt=""
              />
            </div>
          </div>
          <div class="bdan">
            <el-form ref="queryFormRef" :model="queryParams" :inline="true">
              <el-form-item label="所属组别:">
                <el-select v-model="value" placeholder="请选择所属组别" size="large">
                  <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  />
                </el-select>
              </el-form-item>
              <div
                style="
                  width: 100%;
                  display: flex;
                  justify-content: space-between;
                  align-items: center;
                "
              >
                <el-form-item label="账号">
                  <el-input placeholder="请输入账号" clearable />
                </el-form-item>
                <el-form-item label="手机号">
                  <el-input placeholder="请输入手机号" clearable />
                </el-form-item>
              </div>
              <div
                style="
                  width: 100%;
                  display: flex;
                  justify-content: space-between;
                  align-items: center;
                "
              >
                <el-form-item label="昵称">
                  <el-input placeholder="请输入昵称" clearable />
                </el-form-item>
                <el-form-item label="密码">
                  <el-input placeholder="请输入密码" clearable />
                </el-form-item>
              </div>
              <el-form-item label="状态">
                <el-radio-group v-model="queryParams.val" size="small">
                  <el-radio label="1" size="32" border>隐藏</el-radio>
                  <el-radio label="2" size="32" border>显示</el-radio>
                </el-radio-group>
              </el-form-item>
              <div class="btnss">
                <el-button @click="handleResetQuery">取消</el-button>
                <el-button type="primary" @click="handleQuery">确定</el-button>
              </div>
            </el-form>
          </div>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script setup lang="ts">
import { Search } from "@element-plus/icons-vue";
const disabledDate = (time: Date) => {
  return time.getTime() > Date.now();
};
const options = [
  {
    value: "Option1",
    label: "Option1",
  },
  {
    value: "Option2",
    label: "Option2",
  },
  {
    value: "Option3",
    label: "Option3",
  },
  {
    value: "Option4",
    label: "Option4",
  },
  {
    value: "Option5",
    label: "Option5",
  },
];
const query = reactive({
  value1: "",
  value: "",
});
const queryParams = reactive({
  val: 1,
  val1: 10,
  val2: "",
});
const popubool = ref(false);

const tableData = [
  {
    id: 1,
    yijiclassname: "公共假期",
    hangye: "行业名称",
    yewuname: "业务名称",
    addtime: "2025-10-20 12:00:00",
    quanzhong: "业务名称",
    status: 1,
    zh: 13933029012,
  },
  {
    id: 1,
    yijiclassname: "公共假期",
    hangye: "行业名称",
    yewuname: "业务名称",
    addtime: "2025-10-20 12:00:00",
    quanzhong: "业务名称",
    status: 2,
    zh: 13933029012,
  },
  {
    id: 1,
    yijiclassname: "公共假期",
    hangye: "行业名称",
    yewuname: "业务名称",
    addtime: "2025-10-20 12:00:00",
    quanzhong: "业务名称",
    status: 2,
    zh: 13933029012,
  },
  {
    id: 2,
    yijiclassname: "公共假期",
    hangye: "行业名称",
    yewuname: "业务名称",
    addtime: "2025-10-20 12:00:00",
    quanzhong: "业务名称",
    status: 1,
    zh: 13933029012,
  },
  {
    id: 4,
    yijiclassname: "公共假期",
    hangye: "行业名称",
    yewuname: "业务名称",
    addtime: "2025-10-20 12:00:00",
    quanzhong: "业务名称",
    status: 1,
    zh: 13933029012,
  },
  {
    id: 5,
    yijiclassname: "公共假期",
    hangye: "行业名称",
    yewuname: "业务名称",
    addtime: "2025-10-20 12:00:00",
    quanzhong: "业务名称",
    status: 1,
    zh: 13933029012,
  },
];
function tableHeaderStyle({ row, rowIndex, column, columnIndex }) {
  if (column.rowSpan == 1) {
    console.log(column);

    if (column.index == "1") {
      return { background: "#21A193", color: "#fff" };
    }

    if (column.label == "周六" || column.label == "周日")
      return { background: "#21A193", color: "#fff" };
  }
}
function tableHeaderStyle1({ row, rowIndex, column, columnIndex }) {
  console.log(rowIndex, "row-----------");
  if (rowIndex == 7) {
    return { color: "#F53F3F" };
  }
  if (rowIndex == 6) {
    return { color: "#1D2129", "font-weight": "bold" };
  }
}
const arraySpanMethod = ({ row, column, rowIndex, columnIndex }: SpanMethodProps) => {
  if (rowIndex === 6) {
    if (columnIndex === 0) {
      return [1, 3];
    } else if (columnIndex === 1) {
      return [0, 0];
    } else if (columnIndex === 2) {
      return [0, 0];
    }
  }
};
</script>
<style lang="scss" scoped>
.el-form-item--default .el-form-item__content {
  width: 296px;
}
.timebox {
  display: flex;
  align-items: center;
  margin-left: 22px;
  width: 22.5625rem;
  justify-content: space-between;
  .borderline {
    width: 19px;
    height: 1px;
    background: #86909c;
    border-radius: 1px 1px 1px 1px;
  }
}
::v-deep .el-select--large .el-select__wrapper {
  width: 39.5rem;
  background: #f7f8fa;
  border-radius: 6px 6px 6px 6px;
  border: none !important;
  box-shadow: none;
}
.custom-date-picker-container {
  position: relative;
  width: 9.75rem;
}
.custom-date-picker-container :deep(.el-input__prefix) {
  display: none !important;
}

.custom-date-picker-container :deep(.el-input__suffix) {
  left: 12px;
  right: auto;
}

.custom-date-picker-container::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background-image: url("/src/assets/images/微信图片_20250904101932_36_215.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  z-index: 2;
}
::v-deep .el-table thead th {
  background: #f2f3f5;
  color: #1d2129;
}

::v-deep .el-dialog--center {
  padding: 0 !important;
}
::v-deep .el-dialog__header {
  border: none !important;
  padding: 0 !important;
}
.btnss {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  .el-button {
    width: 118px;
    height: 41px;
  }
}
.popubox {
  width: 100%;
  overflow: hidden;
  .bdan {
    width: 39.5rem;
    margin: auto;
    margin-top: 19px;
    ::v-deep .el-form-item {
      display: block;
    }
    :v-deep .el-input {
      width: 300px;
    }
    ::v-deep .el-radio__input.is-checked .el-radio__inner {
      background: #ffffff !important;
    }
    ::v-deep .el-radio__input.is-checked .el-radio__inner::after {
      background: #003779 !important;
      width: 8px;
      height: 8px;
    }
    ::v-deep .el-form-item__label {
      height: 32px;
      width: 100%;
      line-height: 32px;
      display: block;
      text-align: left !important;
      margin-bottom: 16px;
    }
  }
  .qdbtn {
    width: 113px;
    height: 44px;
    background: #003779;
    border-radius: 6px 6px 6px 6px;
    text-align: center;
    line-height: 44px;
    font-family:
      PingFang SC,
      PingFang SC;
    font-weight: 400;
    font-size: 15px;
    color: #ffffff;
    margin-left: 789px;
    margin-top: 24px;
  }
  .xzbox {
    width: 87.5rem;
    margin: auto;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    .el-select {
      width: 18.6875rem;
      border-radius: 6px 6px 6px 6px;
      display: flex;
      font-size: 1rem;
      align-items: center;
    }
    .daochubtn {
      width: 7.0625rem;
      height: 2.75rem;
      border: 1px solid #4e5969;
      border-radius: 4px 4px 4px 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.9375rem;
      color: #4e5969;
      img {
        width: 1rem;
        height: 1rem;
      }
    }
  }
  .titleboxs {
    width: 87.5rem;
    margin: auto;
    margin-top: 16px;
    height: 60px;
    background: #edf1fc;
    border-radius: 8px 8px 8px 8px;
    display: flex;
    align-items: center;

    .yijibt {
      margin-left: 24px;
      font-family:
        PingFang SC,
        PingFang SC;
      font-weight: bold;
      font-size: 1.125rem;
      color: #003779;
    }
    .fgx {
      width: 1px;
      height: 2.75rem;
      border-radius: 0px 0px 0px 0px;
      background: rgba(0, 55, 121, 0.5);
      margin-left: 4.625rem;
    }
    .erjibt {
      font-family:
        PingFang SC,
        PingFang SC;
      font-weight: bold;
      font-size: 1.125rem;
      color: #003779;
      margin-left: 44px;
    }
  }
  .backtop {
    width: 100%;
    height: 54px;
    background: #e5e6eb;
    display: flex;
    align-items: center;
    .topline {
      width: 40.5rem;

      margin: auto;
      display: flex;
      justify-content: space-between;
      .text {
        font-family:
          PingFang SC,
          PingFang SC;
        font-weight: bold;
        font-size: 18px;
        color: #4e5969;
      }
      img {
        width: 24px;
        height: 24px;
      }
    }
  }
}
.yemmabox {
  margin-top: 19px;
  display: flex;
  align-items: center;
  font-family:
    PingFang SC,
    PingFang SC;
  margin-bottom: 22px;
  width: 546px;
  position: relative;
  .sybox {
    width: 61px;
    height: 24px;
    border-radius: 3px 3px 3px 3px;
    border: 1px solid #86909c;
    text-align: center;
    line-height: 24px;
    font-family:
      PingFang SC,
      PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: #86909c;
    position: absolute;
    margin-left: 62px;
  }

  .sybox1 {
    width: 61px;
    height: 24px;
    border-radius: 3px 3px 3px 3px;
    border: 1px solid #86909c;
    text-align: center;
    line-height: 24px;
    font-family:
      PingFang SC,
      PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: #86909c;
    position: absolute;
    right: 153px;
  }
}
::v-deep .btn-next {
  background-color: #fff !important;
  margin-left: 70px !important;
}

.gongtotal {
  font-weight: bold;
  font-size: 14px;
  color: #003779;
  margin-right: 24px;
}
::v-deep .el-pager li {
  min-width: 24px;
  height: 24px;
  margin: 0 14px;
  padding: 0 !important;
}

::v-deep .el-pagination.is-background .el-pager li {
  margin: 0 0px !important;
  margin-right: 14px !important;
}

.msgbox {
  width: 574px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family:
    PingFang SC,
    PingFang SC;
  font-weight: 400;
  font-size: 20px;
  margin: 45px auto;
  color: #003779;
}
.msgbox img {
  width: 574px;
  height: 452px;
  margin-bottom: 50px;
}
.jiaqitop {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  .addtj {
    width: 7rem;
    height: 2.75rem;

    border-radius: 6px 6px 6px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family:
      PingFang SC,
      PingFang SC;
    font-weight: 400;
    font-size: 0.9375rem;
    color: #ffffff;
    img {
      width: 0.5625rem;
      height: 0.5625rem;
    }
  }
  .titlel {
    display: flex;
    align-items: center;
    .titlel_box {
      width: 4px;
      height: 23px;
      background: #003779;
      border-radius: 0px 6px 6px 0px;
    }
    .titlel_tt {
      font-family:
        PingFang SC,
        PingFang SC;
      font-weight: bold;
      font-size: 1.375rem;
      color: #1d2129;
      margin-left: 9px;
    }
  }
}

.containers {
  width: 100%;
  background: #ffffff;
  overflow: hidden;
  border-radius: 16px 16px 16px 16px;
  margin-top: 1.25rem;
  padding: 0 1.5rem;
}
.containers .center1 {
  margin-top: 1.1875rem;
}
.top1 {
  width: 100%;
  height: 54px;
  background: #fff9ed;
  border-radius: 10px 10px 10px 10px;
  display: flex;
  align-items: center;
  font-family:
    PingFang SC,
    PingFang SC;
  font-weight: bold;
  font-size: 16px;
  color: #ff7d00;
  img {
    width: 20px;
    height: 20px;
    margin-left: 14px;
    margin-right: 10px;
  }
}
::v-deep .el-pagination__total {
  font-weight: bold;
  font-size: 14px;
  color: #003779;
  margin-right: 99px;
}
.containerr {
  width: 100%;
  height: 80px;
  background: #ffffff;
  border-radius: 12px 12px 12px 12px;
  display: flex;
  margin-bottom: 20px;
  align-items: center;
  margin-top: 24px;
  position: relative;
  ::v-deep .el-input {
    width: 18.6875rem;
    font-size: 1rem;
    height: 2.75rem;
    margin-left: 24px;
  }
  .daochubtn {
    width: 7rem;
    height: 2.75rem;
    background: #f7f8fa;
    border-radius: 6px 6px 6px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family:
      PingFang SC,
      PingFang SC;
    font-weight: 400;
    font-size: 0.9375rem;
    color: #4e5969;
    position: absolute;
    right: 0%;
    margin-right: 24px;
  }
  .daochubtn img {
    width: 16px;
    height: 16px;
  }
  .el-button {
    width: 7.0625rem;
    height: 2.75rem;
    border-radius: 4px 4px 4px 4px;
    margin-left: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    img {
      width: 1.0625rem;
      height: 1.0625rem;
    }
  }
}

::v-deep .el-input__wrapper {
  background: #f7f8fa;
  box-shadow: none !important;
}
.borderline {
  width: 19px;
  height: 1px;
  background: #86909c;
  border-radius: 1px 1px 1px 1px;
}
::v-deep .el-date-editor.el-input {
  width: 9.75rem;
  height: 44px;
  background: #f7f8fa;
  border-radius: 6px 6px 6px 6px;
}

.timebox {
  display: flex;
  align-items: center;
  margin-left: 22px;
  width: 22.5625rem;
  justify-content: space-between;
  ::v-deep .el-input {
    margin-left: 0px !important;
  }
}

::v-deep .el-select--large .el-select__wrapper {
  width: 18.6875rem;
  height: 2.75rem;
  background: #f7f8fa;
  border-radius: 6px 6px 6px 6px;
  border: none !important;
  box-shadow: none;
}
.el-table {
  margin-top: 20px;
}
</style>
